package com.jiangnan.warehouse_management.dto.response;

import com.fasterxml.jackson.annotation.JsonFormat;
import lombok.Data;
import java.sql.Timestamp;

@Data
public class InventoryResponse {
    private Integer inventoryId;
    private Integer itemId;
    private ItemDTO item;
    private Integer warehouseId;
    private WarehouseDTO warehouse;
    private Integer quantity;
    private Double averagePrice;
    private Double totalValue;
    @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss", timezone = "Asia/Shanghai")
    private Timestamp lastInboundTime;
    @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss", timezone = "Asia/Shanghai")
    private Timestamp lastOutboundTime;
    @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss", timezone = "Asia/Shanghai")
    private Timestamp updatedAt;

    @Data
    public static class ItemDTO {
        private Integer itemId;
        private String itemName;
        private String specification;
        private String unit;
        private Integer minimumStock;
        private Integer maximumStock;
    }

    @Data
    public static class WarehouseDTO {
        private Integer warehouseId;
        private String warehouseName;
        private String location;
    }
}